/*
 *  libCV.h
 *  libCV
 *
 *  Created by Gregory Koch on 14/01/11.
 *  Copyright 2011 IFlyBotIV. All rights reserved.
 *
 */

#ifndef LIBCV_H
#define LIBCV_H


#define IMG_RGB24           0
#define IMG_BGR24			1
#define IMG_BINARY8			2
#define IMG_GREYSCALE8		3

typedef struct cvSize_s
{
	int height;
	int width;
} cvSize_t;

typedef struct cvPos_s
{
	int x;
	int y;
} cvPos_t;

typedef struct image_s
{
	int type;
	unsigned char *data;
	cvSize_t size;
	int stride;
} image_t;

typedef struct zone_s
{
	cvSize_t size;
	cvPos_t pos;
} zone_t;

cvPos_t init_pos(int x, int y);

cvSize_t init_size(int width, int height);

image_t init_image(int type, cvSize_t size);

image_t set_image(int type, cvSize_t size, int stride, unsigned char* datas);

void free_image(image_t image);

zone_t init_zone(cvPos_t pos, cvSize_t size);

int verif_zone(image_t img, zone_t zone);

void move_zone(zone_t *zone, cvPos_t pos, image_t img);

void resize_zone(zone_t *zone, cvSize_t size, image_t img);

void center_zone(zone_t *zone, cvPos_t pos, image_t img);

void draw_zone(image_t img, zone_t zone);

float dist(cvPos_t pos1, cvPos_t pos2);

float kernel_dist(zone_t zone, cvPos_t pos);


#endif
